package com.dubbo.consumer.regController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.common.dtos.ResponseResult;
import com.dubbo.model.regulate.dtos.RegCatalogDto;
import com.dubbo.model.regulate.pojos.RegCatalog;
import com.dubbo.regulate.SonCatalogService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/*
 * 子目录表
 * */
@RestController
@RequestMapping("/SonCatalog")
public class SonCatalogController {

    @Reference(check = false)
    private SonCatalogService sonCatalogService;

    @PostMapping("/Son")
    public ResponseResult<List<RegCatalog>> PCatalogList(@RequestBody Map<String,Object> map){
        RegCatalogDto regCatalogDto = new RegCatalogDto();
        regCatalogDto.setCManageId((Integer) map.get("cManageId"));
        return sonCatalogService.ParentsCatalogList(regCatalogDto);
    }
}
